home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crosscountry USA Photo Safari
/
Crosscountry USA Photo Safari.iso
/
Data
/
cc_base
/
pak00_16bit_f.pk3
/
system.tab.p
< prev
next >
Wrap
Text File
|
2003-01-03
|
10KB
|
297 lines
{
X = -230;
Y = 60;
state = 0;
rest_x = -230;
expand_x = -10;
Hidden = 1;
ScriptID = script {
@loaded {
resid plateID;
resid tabID;
int plate_width;
plateID = GuiChildByName(SELF, "plate");
tabID = GuiChildByName(SELF, "tab");
plate_width = ResPropGetInt(plateID, "Width");
ResPropSetInt(SELF, "rest_x", - plate_width);
ResPropSetInt(tabID, "X", plate_width - 4);
}
};
ChildID = {
GuiAnimation("plate") {
AnimationID = "gui/dash/tab/plate/plate.pcx";
X = 0;
Width = 235;
Height = 180;
},
GuiAnimation("tab") {
X = 240;
Y = 11;
AnimationID = "gui/dash/tab/system/system_off.pcx";
ScriptID = script {
@activate {
resid Parent;
resid Player;
resid Game;
Game = ResByName("Game");
Player = ResPropGetResID(ResByName("Game"),"game_cur_player");
Parent = GuiParent(SELF);
if ( ResPropGetResID(Player,"truck_tab_expanded") == Parent) {
ResPropSetResID(Player,"truck_tab_expanded",RES_INVALID);
ResPropSetInt(GuiSiblingByName("menu_layer"),"Hidden",TRUE);
ResPropSetInt(GuiSiblingByName("save_layer"),"Hidden",TRUE);
} else {
ResPropSetInt(GuiSiblingByName("menu_layer"),"Hidden",FALSE);
ResPropSetInt(GuiSiblingByName("save_layer"),"Hidden",TRUE);
ResPropSetResID(Player,"truck_tab_expanded",Parent);
GuiToFront(Parent);
}
}
@animate {
resid Parent;
int state;
resid Player;
resid Game;
Game = ResByName("Game");
Player = ResPropGetResID(ResByName("Game"),"game_cur_player");
Parent = GuiParent(SELF);
if ( ResPropGetResID(Player,"truck_tab_expanded") == Parent) {
ResPropSetInt(Parent,"X",ResPropGetInt(Parent,"expand_x"));
ResPropSetInt(GuiSiblingByName("plate"),"Hidden",FALSE);
} else {
ResPropSetInt(GuiSiblingByName("plate"),"Hidden",TRUE);
ResPropSetInt(Parent,"X",ResPropGetInt(Parent,"rest_x"));
}
}
}
},
GuiLayer("menu_layer") {
X = 20;
Y = 10;
ChildID = {
GuiTextInput("menu_message") {
X = 0;
Y = 0;
Width = 190;
Height = 40;
WordWrap = TRUE;
InputDisabled = TRUE;
FontID = "font/tab_w_on_g.tf";
ScriptID = Script {
@show {
ResPropSetStr(SELF,"InputText",MangleSIDToStr(232/*"Use this menu to save your game."*/));
}
};
},
GuiButton("save_button") {
X = 45;
Y = 50;
TextID = Mangle(233/*"Save Game"*/);
StyleID = "gui/dash/tab/button/tab.gbs";
FontID = "font/tab_button.tf";
Width = 120;
AutoSize = Height;
ScriptID = Script {
@activate {
resid Player;
resid Game;
Game = ResByName("Game");
Player = ResPropGetResID(ResByName("Game"),"game_cur_player");
if (ResPropGetInt(Player,"nav_at_city") == 1) {
ResPropSetInt(GuiUncleByName("save_layer"),"Hidden",FALSE);
ResPropSetInt(GuiParent(SELF),"Hidden",TRUE);
} else {
ResPropSetStr(GuiSiblingByName("menu_message"),"InputText",MangleSIDToStr(234/*"You must be at a city to save. Drive to the next city."*/));
}
}
}
},
GuiButton("quit_game") {
X = 45;
Y = 90;
TextID = Mangle(235/*"Quit Game"*/);
StyleID = "gui/dash/tab/button/tab.gbs";
FontID = "font/tab_button.tf";
Width = 120;
AutoSize = Height;
ScriptID = Script {
@activate {
ResParseEvent(ResByName("common/init_game_objects.c4"), "@init_game_objects");
release("floor");
mark("floor");
ResByName("splash_screen.gl");
}
}
},
GuiButton("exit_program") {
X = 45;
Y = 130;
TextID = Mangle(236/*"Exit Program"*/);
StyleID = "gui/dash/tab/button/tab.gbs";
FontID = "font/tab_button.tf";
Width = 120;
AutoSize = Height;
ScriptID = Script {
@activate {
Command("quit");
}
}
}
};
},/* end of menu_layer */
GuiLayer("save_layer") {
X = 20;
Y = 10;
Hidden = 1;
ChildID = {
GuiTextInput("save_message") {
X = 0;
Y = 0;
Width = 190;
Height = 50;
WordWrap = TRUE;
InputDisabled = TRUE;
FontID = "font/tab_w_on_g.tf";
ScriptID = Script {
@show {
ResPropSetStr(SELF,"InputText",MangleSIDToStr(237/*"Type a name for your game and click save. File names must have less than 27 characters."*/));
}
};
},
GuiTextInput("save_filename") {
AnimationID = "gui/square/window/window_text_entry.pcx";
X = 25;
Y = 75;
Width = 140;
Height = 22;
FontID = "font/verdana_9_black.tf";
InsertCursorID = "gui/dash/tab/insert_cursor.pcx";
OverwriteCursorID = "gui/dash/tab/overwrite_cursor.pcx";
InputText = "";
ScriptID = Script {
@show {
resid Game;
Game = ResByName("Game");
if (! StrExact("",ResPropGetStr(Game, "game_save_name"))) {
ResPropSetStr(SELF,"InputText",ResPropGetStr(Game, "game_save_name"));
}
}
};
},
GuiButton("back") {
X = 35;
Y = 120;
TextID = Mangle(238/*"Back"*/);
StyleID = "gui/dash/tab/button/tab.gbs";
FontID = "font/tab_button.tf";
Width = 60;
AutoSize = Height;
ScriptID = Script {
@activate {
ResPropSetInt(GuiUncleByName("menu_layer"),"Hidden",FALSE);
ResPropSetInt(GuiParent(SELF),"Hidden",TRUE);
}
}
},
GuiButton("save") {
X = 105;
Y = 120;
TextID = Mangle(239/*"Save"*/);
StyleID = "gui/dash/tab/button/tab.gbs";
FontID = "font/tab_button.tf";
Width = 60;
AutoSize = Height;
ScriptID = Script {
@activate {
resid Player;
resid Game;
str filename;
str full_path;
Game = ResByName("Game");
Player = ResPropGetResID(Game,"game_cur_player");
/* get the filename */
filename = ResPropGetStr(GuiSiblingByName("save_filename"),"InputText");
/* stop right now if there is nothing */
if (StrExact("",filename)) {
ResPropSetStr(GuiSiblingByName("save_message"),"InputText",MangleSIDToStr(240/*"You must type a file name."*/));
stop;
}
/* check that the length of the filename is not too long */
if (StrLen(filename) >= 27) {
ResPropSetStr(GuiSiblingByName("save_message"),"InputText",MangleSIDToStr(241/*"The file name you have chosen is too long."*/));
stop;
}
/* set this name in the game object so we dont keep asking the user */
ResPropSetStr(Game, "game_save_name", filename);
/* form the full path */
if (StrIn(filename, ".sav")) {
full_path = StrFormatStr("%s%s", CVarGetStr("SavedGameDir"),filename);
} else {
filename = StrFormatStr("%s.sav", filename);
full_path = StrFormatStr("%s%s", CVarGetStr("SavedGameDir"),filename);
}
/* check if the file exists*/
if (FileExist(full_path)) {
/* only bitch about new filenames that exist */
if (! StrExact(StrFormatStr("%s.sav", ResPropGetStr(Game,"game_save_name")),filename)) {
ResPropSetStr(GuiSiblingByName("save_message"),"InputText",MangleSIDToStr(242/*"The file name you have chosen already exists."*/));
stop;
}
}
/* save the game */
if (ResSaveAs(ResByName("Game"),full_path)) {
ResPropSetStr(GuiSiblingByName("save_message"),"InputText",StrFormatStr(MangleSIDToStr(243/*"Your game has been saved to '%s'."*/), filename));
ResPropSetInt(GuiUncleByName("menu_layer"),"Hidden",FALSE);
ResPropSetInt(GuiParent(SELF),"Hidden",TRUE);
} else {
ResPropSetStr(GuiSiblingByName("save_message"),"InputText",MangleSIDToStr(244/*"Could not save game. Check save game path."*/));
}
}
}
}
};
} /* end of save_layer */
};
}